package com.jeesite.modules.kj.api.vo.request;

import com.jeesite.modules.kj.api.vo.request.base.BaseRequestVo;
import com.jeesite.modules.kj.entity.KjIntegralAuth;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.poi.hpsf.Decimal;
import org.springframework.beans.BeanUtils;

import java.math.BigDecimal;
import java.util.Date;

@Data
public class IntegralAuthRequestVo extends BaseRequestVo<KjIntegralAuth> {
    @ApiModelProperty(name="serviceName", value="服务名", example = "000111")
    String serviceName;

    @ApiModelProperty(name="serviceType", value="服务类别", example = "1")
    String serviceType;

    @ApiModelProperty(name="serviceTime", value="服务时间", example = "2021-01-01")
    Date serviceTime;

    @ApiModelProperty(name="province", value="省", example = "广东省")
    String province;

    @ApiModelProperty(name="city", value="市", example = "深圳市")
    String city;

    @ApiModelProperty(name="region", value="区", example = "南山区")
    String region;

    @ApiModelProperty(name="country", value="国", example = "中国")
    String country;

    @ApiModelProperty(name="address", value="详细地址", example = "xxxxx街")
    String address;

    @ApiModelProperty(name="totalHour", value="服务时长", example = "1")
    BigDecimal totalHour;

    @ApiModelProperty(name="imgs", value="多图上传", example = "1")
    String imgs;

    @ApiModelProperty(name="description", value="服务内容描述", example = "1")
    String description;

    @ApiModelProperty(name="id", value="id", example = "1")
    String id;

    @Override
    public KjIntegralAuth convertToEntity() {
        KjIntegralAuth auth = new KjIntegralAuth();
        if(totalHour == null){
            totalHour = BigDecimal.ZERO;
        }
        BeanUtils.copyProperties(this, auth);
        return auth;
    }
}
